How do I put a calculation inside a for loop with an if statement in between

welcome to shbcf.ru